package com.training.bt.entity;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("download_history")

public class DownloadHistory {
    @TableId(type = IdType.NONE)
    private Long userId;

    private Long resourceId;

    @TableField("points_used")
    private Integer pointsUsed;

    @TableField(value = "download_time", fill = FieldFill.INSERT)
    @Builder.Default // 为Builder提供默认值
    private LocalDateTime downloadTime = LocalDateTime.now();
}    